class Car:
    wheels = 4
    def drive(self):
        print('开车方式')
    def stop(self):
        print('停车方式')

my_Car = Car()
print(my_Car.wheels)
my_Car.drive()
my_Car.stop()


class persinInfo:
      __weight = 55
      def info(self):
          print('111')



class personInfo:
    __weight = 55
    def __info(self):
        print(f'我的体重是{self.__weight}kg')
    def get_weight(self):
        print(f'我的体重是{self.__weight}kg')
        self.__info()
pefson = personInfo()
pefson.get_weight()

#构建方法
class person:
    def __init__(self,name,sex):
        self.name = name
        self.sex = sex
    def introduce(self):
        print(f'姓名：{self.name}')
        print(f'性别：{self.sex}')
        person_one = person('左飞','男')
        person_one.introduce()
        person_two = person('上','下')


class Person:
    def __init__(self, name, sex):
        self.name = name
        self.sex = sex

    def introduce(self):
        print(f'姓名: {self.name}')
        print(f'性别: {self.sex}')


person_one = Person('小李', '女')
person_one.introduce()
person_two = Person('小张', '男')
person_two.introduce()


class Test:
    @classmethod
    def use_classmet(cls):
        print("我是类方法")


test = Test()
test.use_classmet()
Test.use_classmet()


class Apple:
    count = 0

    @classmethod
    def add_two(cls):
        cls.count = 2


apple = Apple()
print(Apple.count)
Apple.add_two()
print(Apple.count)


class Example:
    num = 10
    @staticmethod
    def static_method():
        print(f"类属性的值为: {Example.num}")
        print("---静态方法---")

example = Example()
example.static_method()
Example.static_method()


class Amphibian:
    name = "两栖动物"
    def features(self):
        print("幼年用鳃呼吸")
        print("成年用肺兼皮肤呼吸")

class Frog(Amphibian):
    def attr(self):
        print("我会呱呱叫")

frog = Frog()
print(Frog.name)
frog.features()
frog.attr()


class English:
    def receive_eng_know(self):
        print("具备英语知识。")

class Math:
    def receive_math_know(self):
        print("具备数学知识。")

class Student(English, Math):
    def study(self):
        print("学生的任务是学习。")

stu = Student()
stu.receive_eng_know()
stu.receive_math_know()
stu.study()










